# 替换~/.ssh/config下的代理ip地址，前提是先按./gitProxy.sh配置好github ssh proxy
if [ -f ~/.ssh/config ]; then
    echo "文件存在"
else
    cat << EOF > ~/.ssh/config
Host github.com
  Hostname ssh.github.com
  Port 443
  ProxyCommand nc -X connect -x 172.25.208.1:7777 %h %p
EOF
fi
# dns地址对应为win localhost
ip=$(grep -m 1 '^nameserver' /etc/resolv.conf | awk '{print $2}')
sed -i "s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/$ip/g" ~/.ssh/config